package demo2;
interface B {
    void fun();
}
class A implements B{
    @Override
    public void fun() {
        System.out.println("hello");
    }
}
public class Test {
    public static void main(String[] args) {
        print(new A());
    }
    public static void print(B b) {
        if (b instanceof B) {
            b.fun();
            System.out.println();
        }
    }
}
